package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the EQUIP_USE database table.
 * 
 */
@Entity
@Table(name="EQUIP_USE")
@NamedQuery(name="EquipUse.findAll", query="SELECT e FROM EquipUse e")
public class EquipUse implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="USE_ID")
	private long useId;

	@Temporal(TemporalType.DATE)
	@Column(name="USE_BTIME")
	private Date useBtime;

	@Column(name="USE_NAME")
	private String useName;

	@Column(name="USE_PROJECT")
	private String useProject;

	//bi-directional many-to-one association to EquipRepair
	@OneToMany(mappedBy="equipUse")
	private List<EquipRepair> equipRepairs;

	//bi-directional many-to-one association to OfficeFunction
	@ManyToOne
	@JoinColumn(name="OFFICE_FUNCTION_ID")
	private OfficeFunction officeFunction;

	public EquipUse() {
	}

	public long getUseId() {
		return this.useId;
	}

	public void setUseId(long useId) {
		this.useId = useId;
	}

	public Date getUseBtime() {
		return this.useBtime;
	}

	public void setUseBtime(Date useBtime) {
		this.useBtime = useBtime;
	}

	public String getUseName() {
		return this.useName;
	}

	public void setUseName(String useName) {
		this.useName = useName;
	}

	public String getUseProject() {
		return this.useProject;
	}

	public void setUseProject(String useProject) {
		this.useProject = useProject;
	}

	public List<EquipRepair> getEquipRepairs() {
		return this.equipRepairs;
	}

	public void setEquipRepairs(List<EquipRepair> equipRepairs) {
		this.equipRepairs = equipRepairs;
	}

	public EquipRepair addEquipRepair(EquipRepair equipRepair) {
		getEquipRepairs().add(equipRepair);
		equipRepair.setEquipUse(this);

		return equipRepair;
	}

	public EquipRepair removeEquipRepair(EquipRepair equipRepair) {
		getEquipRepairs().remove(equipRepair);
		equipRepair.setEquipUse(null);

		return equipRepair;
	}

	public OfficeFunction getOfficeFunction() {
		return this.officeFunction;
	}

	public void setOfficeFunction(OfficeFunction officeFunction) {
		this.officeFunction = officeFunction;
	}

}